<?php

/*
 * This file is part of the slince/dragbox package.
 *
 * (c) Slince <taosikai@yeah.net>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace DragBox\Common\Filesystem;

interface FilesystemInterface
{
    /**
     * Creates index
     */
    public function index();

    /**
     * Finds the file
     *
     * @param string $key
     * @return FileInterface|null
     */
    public function find($key);

    /**
     * Queries the files states
     *
     * @param FileInterface[] $files
     */
    public function queryStates($files);

    /**
     * Create a stream pipe.
     *
     * @param string $key
     * @param string $mode
     * @return resource
     */
    public function createStream($key, $mode = 'r');
}